home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.1 (Developer) [x86]
/
NeXT Step 3.1 Intel dev.cdr.dmg
/
NextDeveloper
/
Examples
/
AppKit
/
UnderPressure
/
Brush.h
< prev
next >
Wrap
Text File
|
1992-06-11
|
1KB
|
45 lines
#if 0
Brush.h -- Pressure sensitive paint brush
by Peter Graffagnino, NeXT Computer Inc.
You may freely copy, distribute, and reuse the code in this example.
NeXT disclaims any warranty of any kind, expressed or implied, as to its
fitness for any particular use.
#endif
#import <objc/Object.h>
/*
* A pressure sensitive brush whose size is governed by:
* minSize + pressureCoefficient*(inputPressure^pressureExponent)
*/
@interface Brush : Object
{
NXColor brushColor;
float pressureExponent;
float minSize;
float pressureCoefficient;
double lastx, lasty, lastsize; /* last point drawn (for connecting
* strokes)
*/
}
/* drawing the brush */
- brushMoveTo:(float)x :(float)y withPressure:(float) pressure
dirtyRect: (NXRect *) dirty;
- brushLineTo:(float)x :(float)y withPressure:(float) pressure
dirtyRect: (NXRect *) dirty;
/* target/action & outlet-setting methods */
- setMinSize: sender;
- setPressureExponent: sender;
- setBrushColor: sender;
- setPressureCoefficient: sender;
@end